package com.gec.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gec.model.system.ITripItinerary;
import com.gec.model.system.ITripService;
import com.gec.model.system.ITripUser;
import com.gec.model.vo.ITripServiceVo;
import com.gec.system.mapper.ITripServiceMapper;
import com.gec.system.service.ITripServiceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 套餐表 服务实现类
 * </p>
 *
 * @author dafei
 * @since 2024-01-22
 */
@Service
public class ITripServiceServiceImpl extends ServiceImpl<ITripServiceMapper, ITripService> implements ITripServiceService {

    @Override
    public IPage<ITripService> selectPage(IPage<ITripService> page1, ITripServiceVo iTripServiceVo) {

        IPage<ITripService> iPage = this.baseMapper.selectPage(page1,iTripServiceVo,null) ;
        return iPage;
    }

    @Override
    public ITripService selectByName(String serviceName) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("serviceName",serviceName);//相当于where typeNo=1
        List<ITripService> list = baseMapper.selectList(wrapper);
        return list.size()==0 ?null :list.get(0);
    }
}
